A federal judge ordered San Francisco food-delivery company DoorDash to arbitrate over 5,000 actions brought by its delivery drivers in a move that could cost the company millions of dollars.

U.S. District Judge William Alsup ordered DoorDash to comply with the arbitration agreements it made workers accept with a tap on their smartphones. Like many gig-economy companies, DoorDash requires that its couriers, which it calls “dashers,” resolve disputes out of court.